using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

/// <summary>
/// Summary description for DALCheckStatus
/// </summary>
public class DALCheckStatus
{
    /// <summary>
    /// Get CustomerID that goes with the DeliverableID
    /// </summary>
    /// <returns>CustomerID</returns>
    public static int GetCustomerID(int DeliverableID)
	{
        SqlCommand command = DAL.CreateCommand();
        command.Parameters.AddWithValue("@DeliverableID", DeliverableID);
        command.CommandText = SQL.GetCustomerID;
        SqlDataReader reader = DAL.ExecuteReader(command);
        if (reader.Read())
        {
            int CustomerID = reader.GetInt32(0);
            return CustomerID;
        }
        return 0;
    }

    /// <summary>
    /// Get the Customer's Contact Number
    /// </summary>
    /// <returns>Contact Number</returns>
    public static string GetCustomerContactNumber(int CustomerID)
    {
        SqlCommand command = DAL.CreateCommand();
        command.Parameters.AddWithValue("@CustomerID", CustomerID);
        command.CommandText = SQL.GetCustomerContactNumber;
        SqlDataReader reader = DAL.ExecuteReader(command);
        if (reader.Read())
        {
            string ContactNumber = reader.GetString(0);
            return ContactNumber;
        }
        return null;
    }
}
